home *** CD-ROM | disk | FTP | other *** search
- // ALL CODE WHICH IS NOT ENCASED IN A function()
- // IS GLOBAL AND RUNS ON PAGE LOAD
-
- // Sets the browser variable to false by default
-
- browserCheck = false;
-
- // Checks the browser using looking for the browser name and
- // return value of the parseInt function, such as 3 or 4
- // Currently limited to Netscape 4+ and MSIE 4+
-
- if (((navigator.appName == "Netscape") &&
- (parseInt(navigator.appVersion)>= 3 )) ||
- ((navigator.appName == "Microsoft Internet Explorer") &&
- (parseInt(navigator.appVersion) >= 4 ))) {
- browserCheck=true;
- }
-
-
- // Declare all images which will be swapper like the exmaple below
- if (browserCheck) {
-
- aboutin = new Image();
- aboutin.src = 'about_in.gif';
- aboutout = new Image();
- aboutout.src = 'about_out.gif';
- }
-
- // The function that actually does the work
- function swapImage(curImgObj,newImgObj) {
- if (browserCheck) {
- curImgObj.src = eval(newImgObj).src;
- }
- }
-
- // Declare anchors like this:
- / *<A HREF="somewhere.html" onMouseover="swapImage(document.about,'aboutin')" onMouseout="swapImage(document.about,'aboutout')"> <IMG BORDER=0 SRC="about_out.gif" ALT="About this Site" NAME="about"></A> */